<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <title>计算圆形面积</title>
    <script>
      function validateInput() {
        var radius = document.getElementById("radius").value;
        if (isNaN(radius) || radius === "") {
          alert("请输入合法的半径长度");
          return false;
        }
        return true;
      }
    </script>
</head>
<body>
<h2>计算圆形面积</h2>
<form action="/CircleServlet" method="POST" onsubmit="return validateInput()">
  Enter Radius: <input type="text" id="radius" name="radius" placeholder="输入圆形半径"><br><br>
  <input type="submit" value="计算">
</form>
</body>
</html>